import { fliterPermission } from '@/utils/sys.js'

export const apis = {
  list: `business/shelf/getList?modelCode=MODEL_SHELF&authCode=FUNCTION_SHELF_LIST`,
  del: `business/shelf/del?authCode=BTN_SHELF_DEL`,
  add: `business/shelf/add?authCode=BTN_SHELF_ADD`,
  edit: `business/shelf/edit?authCode=BTN_SHELF_EDIT`,
  detail: `business/shelf/detail?modelCode=MODEL_SHELF&authCode=BTN_SHELF_DETAIL`,
};
export const configs = {
  listUrl: apis.list,
  pageOn: true, // 开启分页
  searchOn: true, // 开启搜索
  operateOn: true, //开启操作区域
  treeOn: false, // 开启树形
  searchMode:'custome',
};

export const searchs = [
  {
    type: "Input",
    column: "shelf_no",
    label: "货架号",
  },
];

export const pages = {
  pageSize: 20,
  orders: [
    {
      field: "id",
      sort: "desc",
    },
  ],
};
export const columns = [
 { type: "selection" },
  // { label: "ID", column: "id", sortable: "custom", display: "text" },
  {
    label: "货架号",
    column: "shelf_no",
  },
  {
    label: "备注",
    column: "shelf_desc",
  },

  {
    label: "创建时间",
    column: "ctime",
    display: "text",
    
  },
  {
    label: "修改时间",  
    column: "utime",
    display: "text",
  },
  {
    label: "操作",
    column: "operate",
    width: "220",
    fixed: "right",
  }
];
export const buttons = fliterPermission([
  {
    operate: "add",
    text: "新增",
    permission: 'BTN_SHELF_ADD',
 
  }
  
])
export const columnButtons = fliterPermission([
 
  {
    operate: "edit",
    text: "编辑",
    permission: 'BTN_SHELF_EDIT',

  },
  {
    operate: "delete",
    text: "删除",
    permission: 'BTN_SHELF_DEL',
    type:'danger'
  } 
])
